// Vuex数据共享
var store = new Vuex.Store({
  state: {
    city: '珠海市',
    showloading:false,
    loadingCount: 0,
    title:'艾尔智能科技'

  },
  mutations: {
    changeCity(state, city) {
      state.city = city
    },
    showLoading(){
      if( store.state.loadingCount<=0){
        // store.state.showloading = true;
        jQuery("#loading").show();
      }
      store.state.loadingCount++;
    },
    hideLoading(){
      store.state.loadingCount--;
      if(  store.state.loadingCount<=0){
        // store.state.showloading = false;
        jQuery("#loading").hide();

      }
    },setTitle(state,obj){
      // if(obj.nam){
          window.document.title =store.state.title + obj.name;
      // }
    }
  }
})